package com.markedquilt.comment.coomon;

import lombok.Data;

/**
 * @author ZhangKe
 * @Description
 * @date 2020/4/18 18:08.
 */
@Data
public class CommonRes {


    /**
     * 状态信息
     */
    private String status;

    /**
     * 实体化对象
     */
    private Object data;

    /**
     * 成功的时候返回格式
     * @param result    数据实体化对象
     * @return          json字符串
     */
    public static CommonRes create(Object result){
        return CommonRes.create(result,"success");
    }


    public static CommonRes create(Object result,String status) {
        CommonRes commonRes=new CommonRes();
        commonRes.setStatus(status);
        commonRes.setData(result);
        return commonRes;
    }
}
